class Solution {
public:
    int minArray(vector<int>& numbers) {
        if(numbers.size()==1) return numbers[0];
        if(numbers[0]>=numbers[numbers.size()-1]){
            int i=numbers.size()-1;
            while(numbers[i]>=numbers[i-1]){
                i--;
                if(i<=0) return numbers[0];
            }
            if(i>=0)return numbers[i];
        }
        return numbers[0];
    }
};